<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use DB;

class Type extends Model
{	
	public $collect=[];
	public $yi=[];
	public $xiaoshuo=[];
	public function Typediv()
	{
    $list=DB::table('type')->orderby('path')->get();
   
   // $a=$list->flatten(1);
  
   
   $b=$list->all();
   // dd($b);
 
   foreach($b as $v){
   	if($v->parint_id==1){
   		return $this->yi=$v;

   	}
   	if($v->parint_id==2){
   		return $this->xiaoshuo=$v;
   	}
   	if($v->parint_id==3){
   		$wenyi[]=$v;
   	}
   	if($v->parint_id==4){
   		$qcym[]=$v;
   	}
   	if($v->parint_id==5){
   		$rwsk[]=$v;
   	}
   	if($v->parint_id==6){
   		$jingying[]=$v;
   	}
   	if($v->parint_id==7){
   		$jiaocai[]=$v;
   	}
   	if($v->parint_id==8){
   		$waiyu[]=$v;
   	}
   	if($v->parint_id==9){
   		$kaoshi[]=$v;
   	}
   	if($v->parint_id==10){
   		$tools[]=$v;
   	}
   	if($v->parint_id==11){
   		$zxjiaofu[]=$v;
   	}
   	if($v->parint_id==12){
   		$wenxue[]=$v;
   	}
   	if($v->parint_id==13){
   		$zhuanji[]=$v;
   	}
   	if($v->parint_id==14){
   		$yishu[]=$v;
   	}
   	if($v->parint_id==16){
   		$qcwx[]=$v;
   	}
   	if($v->parint_id==17){
   		$dmym[]=$v;
   	}
   	if($v->parint_id==18){
   		$history[]=$v;
   	}
   	if($v->parint_id==19){
   		$wenhua[]=$v;
   	}
   	if($v->parint_id==20){
   		$guji[]=$v;
   	}
   	if($v->parint_id==21){
   		$xinli[]=$v;
   	}
   	if($v->parint_id==22){
   		$zxzj[]=$v;
   	}
   	if($v->parint_id==23){
   		$zzjs[]=$v;
   	}
   	if($v->parint_id==24){
   		$shkx[]=$v;
   	}
   	if($v->parint_id==25){
   		$fl[]=$v;
   	}
   	if($v->parint_id==26){
   		$manage[]=$v;
   	}
   	if($v->parint_id==27){
   		$tzlc[]=$v;
   	}
   	if($v->parint_id==28){
   		$jingji[]=$v;
   	}
   		
  }

   	
}
}
